package net.daoke.relation.web;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import net.daoke.relation.model.domain.NetworkRelation;
import net.daoke.relation.model.request.AddNetRelationVO;
import net.daoke.relation.service.NetworkService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "网络关系管理")
@RestController
@RequestMapping("/network")
public class NetworkController {

    private final NetworkService service;

    public NetworkController(NetworkService service) {
        this.service = service;
    }

    @Operation(summary = "新增网络关系", description = "新增网络关系")
    @PostMapping("/add")
    public NetworkRelation addRule(@RequestBody AddNetRelationVO addNetRelationVO) {
        return service.addNetworkRelation(addNetRelationVO);
    }

}
